package com.shxt.util;

import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;

public class PageBean {
	public static Map<String , Object> serverMap(Map<String , Object> map,Object user,Integer pages) {
		String t = user.getClass().getSimpleName();
		String type = t.toLowerCase();
		map.put(type , user);

		map.put("number" , (pages-1)*3);

		return map;
	}



	public static Map<String , Object> map(Map<String , Object> map,Class<?> clazz,List<?> userList,Integer count,int pages ) {
		HttpServletRequest request;
		String name = clazz.getSimpleName().toLowerCase();

		int sumPage = count%3==0?count/3:count/3+1;
		if(sumPage==0){
			sumPage = 1;
		}

		String listType = name+"List";

		map.put(listType , userList);
		map.put("pages" , pages);
		map.put("sumPage",sumPage);

		return map;
	}


}
